
package com.voicecheck.util;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Locale;

import android.content.Context;
import android.content.res.Resources;

import com.aris.voicechecking.R;

public class StringUtil {

    public static String getDate() {
        String format = "yyyy-MM-dd";

        SimpleDateFormat sdf = new SimpleDateFormat(format, Locale.JAPAN);

        String date = sdf.format(new Date(System.currentTimeMillis()));

        return date;
    }

    public static String checkPersonName(String sentence, Context ct) {

        Resources res = ct.getResources();
        String[] pname = res.getStringArray(R.array.person_name);

        for (int i = 0; i < pname.length; i++) {
            if (sentence.contains(pname[i])) {
                return pname[i];
            }
        }

        return "";

    }

}
